package com.syaccp.model;

import com.baomidou.mybatisplus.annotation.*;
import com.syaccp.utils.DateUtils;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 订单操作记录表
 *
 * @author Lyh
 */
@TableName(value = "t_order_oper_record")
@Data
@Accessors(chain = true)
public class OrderOperRecord implements Serializable {
    /**
     *
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 订单id
     */
    @TableField(value = "order_id")
    private Integer orderId;

    /**
     * 操作内容
     */
    @TableField(value = "content")
    private String content;

    /**
     * 状态（0正常 1停用）
     */
    @TableField(value = "status")
    private Integer status;

    /**
     * 删除标志（0代表存在 2代表删除）
     */
    @TableField(value = "del_flag")
    @TableLogic(value = "0", delval = "2")
    private Integer delFlag;

    /**
     * 创建者
     */
    @TableField(value = "create_by")
    private Integer createBy;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private LocalDateTime createTime;

    /**
     * 更新者
     */
    @TableField(value = "update_by")
    private Integer updateBy;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private LocalDateTime updateTime;

    /**
     * 备注
     */
    @TableField(value = "remark")
    private String remark;

    /**
     * 节点颜色
     */
    @TableField(exist = false)
    private String color;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;


    public OrderOperRecord(Integer orderId, String content) {
        this.orderId = orderId;
        this.content = content;
        this.createTime = DateUtils.getTodayLocalDateTime();
    }

    public OrderOperRecord() {
    }
}
